Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Dec 8, 2025

This pull request introduces a new "Detailed Plasma Physics" module, adds supporting constants and data structures, and integrates new profile plotting capabilities for advanced plasma diagnostics. The changes enhance the documentation, codebase, and output visualizations, providing more granular insight into plasma behavior and key physical parameters.

Plasma Physics Module & Documentation

  • Added the DetailedPhysics class and its documentation (detailed_physics.md), including methods for calculating Debye length, relativistic particle speed, Coulomb logarithm, classical distance of closest approach, DeBroglie wavelength, plasma frequency, and Larmor frequency. [1] [2] [3]

Data Structures & Constants

  • Introduced new plasma profile variables (Debye length, electron velocity, Coulomb logarithm, plasma and Larmor frequency profiles) in physics_variables.py, with initialization and global registration. [1] [2] [3]
  • Added PLANCK_CONSTANT and updated SPEED_LIGHT to float in constants.py for more accurate physical calculations.

Output & Visualization Enhancements

  • Implemented new plotting functions for Debye length, electron velocity, plasma frequency, Larmor frequency, and Coulomb logarithm profiles in plot_proc.py, integrating them into the main plotting workflow and output PDF.

Integration & Workflow

  • Integrated the new detailed physics calculations and output into the main output pipeline (output.py), ensuring these diagnostics are run and exported at the end of each simulation.

Documentation Navigation

  • Linked the new "Detailed Plasma Physics" documentation page in the navigation sidebar for easier access.## Description

🎨 Output

A new plot_proc page for the electron values of the new functions have been added

image

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@chris-ashe chris-ashe self-assigned this Dec 8, 2025
@chris-ashe chris-ashe requested a review from jonmaddock December 8, 2025 14:27
@chris-ashe chris-ashe added Physics Relating to the physics models Output Files Issues related to the output data files labels Dec 8, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 42.75862% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.30%. Comparing base (726df45) to head (c042380).

Files with missing lines Patch % Lines
process/io/plot_proc.py 5.88% 64 Missing ⚠️
process/physics.py 69.23% 16 Missing ⚠️
process/output.py 0.00% 2 Missing ⚠️
process/main.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4004      +/-   ##
==========================================
+ Coverage   46.29%   46.30%   +0.01%     
==========================================
  Files         123      123              
  Lines       28841    28961     +120     
==========================================
+ Hits        13351    13411      +60     
- Misses      15490    15550      +60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chris-ashe chris-ashe force-pushed the add_general_plasma_functions_1 branch from 3c22809 to c3ccd3b Compare December 8, 2025 14:49
@chris-ashe chris-ashe marked this pull request as ready for review December 8, 2025 16:36
@chris-ashe chris-ashe requested a review from j-a-foster January 5, 2026 10:18
Copy link
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need the docs and formula reviewed still

Copy link
Collaborator

@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question, otherwise happy with equations and docs.

@chris-ashe chris-ashe force-pushed the add_general_plasma_functions_1 branch 2 times, most recently from d9f9e73 to 559509c Compare January 5, 2026 14:44
Copy link
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment on testing, then its gtg

self.plasma_profile = plasma_profile
self.current_drive = current_drive

def run(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its probably worth adding a simple test with a simple profile (2-4 points) that checks all of the values are correctly set in this model

@chris-ashe chris-ashe force-pushed the add_general_plasma_functions_1 branch from 7343c9f to 30dfff3 Compare January 7, 2026 11:09
@chris-ashe chris-ashe force-pushed the add_general_plasma_functions_1 branch from 30dfff3 to 98bb56d Compare January 7, 2026 11:22
@chris-ashe chris-ashe removed the request for review from jonmaddock January 7, 2026 11:23
Copy link
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only comments about the types and I promise its ready. Please update the types for variables that can be a float or a whole profile (ndarray). Ensure you update the type hints and the types in the docstring


@staticmethod
def calculate_debye_length(
temp_plasma_species_kev: float,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type could be float or profile right (np.ndarray)?

) ** 0.5

@staticmethod
def calculate_lorentz_factor(velocity: float) -> float:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

velocity could be float or profile right (np.ndarray)?

return 1 / (1 - (velocity / constants.SPEED_LIGHT) ** 2) ** 0.5

@staticmethod
def calculate_relativistic_particle_speed(e_kinetic: float, mass: float) -> float:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e_kinetic could be float or profile right (np.ndarray)?


@staticmethod
def calculate_plasma_frequency(
nd_particle: float, m_particle: float, z_particle: float
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nd_particle could be a float or ndarray


@staticmethod
def calculate_larmor_frequency(
b_field: float, m_particle: float, z_particle: float
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b_field could be a float or an ndarray

@timothy-nunn timothy-nunn merged commit 2f79156 into main Jan 7, 2026
14 of 18 checks passed
@timothy-nunn timothy-nunn deleted the add_general_plasma_functions_1 branch January 7, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Output Files Issues related to the output data files Physics Relating to the physics models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants